﻿/*
 * 文件名称：
 * 程序员：wangyun
 * 创建时间：2008/05/27
 * 
 * 功能说明：功能模块的字段类型控件，颜色选择控件
 * 
 * 修改人员：yylu
 * 
 * 修改日期：2009/08/20
 * 
 * 修改记录：1)增加控件手写单独使用的代码
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Whir.Common.WebHelper;

public partial class UserControls_FieldControl_ColorType : Whir.Controls.ModelField.BaseFieldControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Whir.BLL.Whir_FieldText bll = new Whir.BLL.Whir_FieldText();
        int fieldTextId = int.Parse(bll.GetList(" FieldID = " + this.FieldID).Tables[0].Rows[0][0].ToString());

        if (this.isSingleUse)
        {
            this.InitFieldControl(this.FieldID);
        }

        if (!IsPostBack)
        {
            int ItemID = NetRequest.GetQueryInt("ItemID");
            if (ItemID == 0)
            {
                //添加操作，绑定默认值
                this.ezwColorType.Value = bll.GetModel(fieldTextId).defaultValue;
            }
            else
            {
                //更新操作，绑定值
                this.ezwColorType.Value = FieldCommon.GetBindValue(this.FieldID, ItemID);
            }
            this.rvfColorType.IsValid = this.EnableNull;    //设置验证控件是否验证颜色的值
        }
        else
        {
            this.FieldValue = this.ezwColorType.Value;
        }
    }
}
